#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    char arr[100];
    scanf("%s", arr);
    char* pa = arr;
    int a = 0;
    int b = 0;
    while (*pa != '0')
    {
        if (*pa == 'A')
        {
            ++a;
        }
        else
        {
            ++b;
        }
        pa++;
    }
    if (a > b)
    {
        putchar('A');
    }
    else if (a < b)
    {
        putchar('B');
    }
    else
    {
        putchar('E');
    }
    return 0;
}